import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.concurrent.PriorityBlockingQueue;

public class Demo1 {
    public static void main(String[] args) throws IOException {
        File file = new File("./text.txt");
        file.createNewFile();
        file.isFile();
        file.isDirectory();
        System.out.println(file.exists());
        //file.deleteOnExit();
        file.delete();
        System.out.println(file.exists());

        String ss = new String();
        char[] s = ss.toCharArray();

        ArrayList<Integer> list = new ArrayList<>();

        PriorityBlockingQueue<Integer> queue = new PriorityBlockingQueue<>();
    }
}

class Solution {
    public int numDecodings(String s) {
        //建表
        char[] chars = s.toCharArray();
        int n = chars.length;
        int[] dp = new int[n];

        //初始化
        if(chars[0] == '0') return 0;
        else dp[0] = 1;
        if(n == 1) return dp[0];

        if(chars[1] != '0') dp[1]++;
        if((chars[0] - '0') * 10 + (chars[1] - '0') <= 26) dp[1]++;
        if(dp[1] == 0) return 0;

        //填表
        for(int i = 2; i < n; i++) {
            if(chars[i] != '0') dp[i] += dp[i-1];
            if((chars[i-1] - '0') != 0 &&
                    (chars[i-1] - '0') * 10 + (chars[i] - '0') <= 26)
                dp[i] += dp[i-2];
            if(dp[i] == 0) return 0;
        }

        //返回值
        return dp[n-1];
    }
}
